<!DOCTYPE html>
<html>
<head>
<meta charset = "utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1" />
<title>《<!--{eval echo $artwork[Title];}-->》- <!--{eval echo $artist[Title];}--> 作品 | 艺高高artgogo.com</title>

<link rel="stylesheet" type="text/css" href="/css/201405/web2.css"/>
<link rel="stylesheet" href="/awesome/css/bootstrap.min.css">
<link rel="stylesheet" href="/awesome/css/font-awesome.min.css">
<script type="text/javascript" src='/js/jquery.js'></script>
<script src="/js/jquery.downCount.js"></script> 
<script src="/js/jquery-migrate-1.2.1.js" type="text/javascript"></script>
<script src="/newwap/weixin_share/jweixin-1.0.0.js"></script>
<script src="/201405/all.js"></script>
<script type="text/javascript">
var itemid=<!--{eval echo $artwork[id];}-->;
$(function(){
    // 保温杯跳转
    if(itemid == 12519) {
        location = 'http://m.artgogo.com/vacuum-cup.html';
    } else if(itemid == 134520) {
        location = 'http://m.artgogo.com/crowdfunding.php?id=134520';
    }
    //微信分享
    var weixin_url=window.location.href;
  //var weixin_url='http://m.artgogo.com/artwork.php?id='+itemid;
    jQuery.ajax({
        type:'POST',
        dataType:'json',
        async:false,
        url:'/newwap/weixin_share/ajax_share.php?url='+weixin_url,
        success:function(data){
            appId=data.appId;
            timestamp=data.timestamp;
            nonceStr=data.nonceStr;
            signature=data.signature;
            url=data.url;
        }
    });


    wx.config({
        debug: false,
        appId: appId,
        timestamp: timestamp,
        nonceStr: nonceStr,
        signature: signature,
        jsApiList: [
          // 所有要调用的 API 都要加到这个列表中
            'onMenuShareAppMessage',
            'onMenuShareTimeline'
        ]
    });



    wx.ready(function () {
    // 在这里调用 API
        var wx_fx_title=$("title").html();
        var desc="<!--{eval echo $artwork[Title];}--> <!--{eval echo $artwork[caizhi];}--> <!--{eval echo $artwork[pinlei];}--> <!--{eval echo $artwork[zhuti];}--><!--{if $artwork[chushou]=='是'}--> RMB <!--{eval echo $artwork[price];}-->元 <!--{elseif $artwork[chushou]=='否'}--> <!--{eval echo ' 展示作品';}--> <!--{else}--> <!--{eval echo $artwork[chushou];}--> <!--{/if}-->";
        var link='http://m.artgogo.com/artwork.php?id='+itemid;
    //var link=window.location.href;
        var imgUrl="http://m.artgogo.com<!--{eval echo $artwork[cover];}-->";
        //获取“分享给朋友”按钮点击状态及自定义分享内容接口
        wx.onMenuShareAppMessage({
            title: wx_fx_title, // 分享标题
            desc: desc, // 分享描述
            link: link, // 分享链接
            imgUrl: imgUrl, // 分享图标
            type: '', // 分享类型,music、video或link，不填默认为link
            dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
            success: function () {
                // 用户确认分享后执行的回调函数
                //alert('分享成功');
            },
            cancel: function () { 
                // 用户取消分享后执行的回调函数
            },
            fail:function(res){
                alert(res);
            }
        });

        //获取“分享到朋友圈”按钮点击状态及自定义分享内容接口
        wx.onMenuShareTimeline({
            title: desc, // 分享标题
            link: link, // 分享链接
            imgUrl: imgUrl, // 分享图标
            success: function () { 
                // 用户确认分享后执行的回调函数
            },
            cancel: function () { 
                // 用户取消分享后执行的回调函数
            }
        });
    });
    //微信分享end
    <!--微信结束-->
});
</script>
</head>
<body>
<!--{template /newwap/tpl/wap_header.html}-->
<style type="text/css">
  .artwork_block {padding: 15px; border-bottom: 1px solid #ccc;}
  .artwork_name {font-size: 23px; font-weight: 800; padding:10px 0px;}
  .artwork_artist {height: 30px; width: 30px; display: inline-block; margin-bottom: -9px; margin-right: 4px;}
  .artwork_info_four {display: block; font-size: 14px; line-height: 28px;}
  .artwork_info_four a {color: #333;}
  .artwork_zan {padding: 10px 15px; font-size: 17px; text-align: center; color: #c00; border:1px solid #c00; border-radius: 5px; margin: 25px auto 15px; display: block; width: 50px;}
  .artwork_list_title {text-align: center; font-size: 17px; font-weight: 800; padding: 15px;}
  .artwork_list_title_left {font-size: 17px; display:block;  font-weight: 800; padding: 10px 0 5px;}
  .artwork_infos {line-height: 30px; display:block;}
  .artwork_price {font-size: 18px; float: left; padding:15px;}
  .artwork_price_original {text-decoration:line-through; font-size: 18px; float: left; padding:15px;}
  .artist_artworks_list {width: 300px; display: block; margin: 10px auto;}
  .artist_artworks_list li {width: 300px; padding-bottom:30px;}
  .artist_artworks_list li img {width: 300px;}
  .artist_artworks_list span {width: 150px; display: block; float: left; padding: 10px 0 5px 0; font-size: 15px; color: #666;}
  .clear {clear: both;}
  .artwork_title {width: 200px !important;}
  .view_artwork {width: 100px !important; text-align: right}
  .view_user_list {width: 300px; margin: 15px auto; display: block; padding-bottom: 30px; border-bottom: 1px solid #ccc}
  .view_user_list li {float: left; padding-right: 10px; }
  .view_user_list li img {width: 40px; height: 40px; border-radius: 20px; }
  .view_user_list li span {  width: 40px;height: 40px; border-radius: 20px; background: #ccc; color: #999; display: block; line-height: 23px; font-size: 30px; text-align: center;}
  .view_user_list:after {content: ''; display: block; clear: both;}
  .comment {border-radius: 4px; border: 1px solid #ccc; padding: 5px 10px; width: 70%; font-size: 15px; height: 30px; }
  .submit {border-radius: 3px !important; background: #3DAF36 !important; border:0 none !important; padding: 10px 10px !important; width: 70px !important; font-size: 15px !important; height: 40px !important; color: #fff !important; }
  .bottom-bar {position: fixed; bottom: 0; height: 50px; width: 100%; background: rgba(200,200,200,0.8);}
  .buy_now {padding: 10px 15px; font-size: 15px; text-align: center; color: #fff; background: #c00; border-radius: 5px; margin: 7px; display: block; float: right;}
  .connect_service {padding: 10px 15px; font-size: 15px; text-align: center; color: #fff; background: #1E89C3; border-radius: 5px; margin: 7px; display: block; float: right;}
  .login_first {padding:5px 10px; color: #333; background: #dedede; border-radius: 5px; height: 31px;    display: inline-block;}

  ul.countdown {display: block;}
  ul.countdown li {display: inline-block;}
  .d-count {font-size: 17px;
    border-radius: 8px;
    background: #700;
    color: yellow;
    line-height: 40px;
    text-align: center;
    margin-bottom: 15px;
    box-shadow: 2px 2px 2px #333;
    font-weight: 800;
}
</style>
<div class='artwork_block' style='padding: 5px 15px;'>
  <a href='tel:4008566108'><img src='/img/top_banner.png' /></a>
</div>
<article>
  <div class="artwork_block">
    <div class='d-count'>
        <ul class="countdown" style="display: none;">
          <li id="countdownTitle">距离结束还有:</li>
          <li> <span class="days">00</span>
          </li>
          <li class="seperator">天</li>
          <li> <span class="hours">00</span>
          </li>
          <li class="seperator">小时</li>
          <li> <span class="minutes">00</span>
          </li>
          <li class="seperator">分钟</li>
          <li> <span class="seconds">00</span>
          </li>
          <li class="seperator">秒</li>
        </ul>
    </div>
    <div class='artwork_img'>
      <img src='<!--{eval echo str_replace('/artwork/', '/yishupin/', $artwork[big_photo]);}-->'/>
    </div>
    <div class='artwork_name bk_name'><!--{eval echo $artwork[Title];}--></div>        
    <div class='artwork_info_four'>
      <a href='http://m.artgogo.com/artist.php?id=<!--{eval echo $artist[id];}-->'><img src='<!--{eval echo $artist[Photo];}-->' class='artwork_artist'/><span><!--{eval echo $artist[Title];}--></span></a> |
        <!--{eval if($artwork[is_print]=='是'){echo '版画';}elseif($artwork[is_derivative]=='是'){echo '衍生品';}else{echo '原作';}}--> 
        | <!--{eval echo $artwork[pinlei];}--> 
        | <!--{eval echo $artwork[width];}--> * <!--{eval echo $artwork[height];}--><!--{if !empty($artwork[length])}--> * <!--{eval echo $artwork[length];}--> <!--{/if}--> cm 
        | <!--{eval echo $artwork[czsj];}-->
    </div>
    <!--{eval if(empty($artist[Summary])){echo '';}else{echo "<div class='artwork_list_title_left'><i class='icon-group'></i> 艺术家简介</div><div class='artwork_infos'>".$artist[Summary]."</div>";}}-->
    <!--{eval if(empty($artwork[zpms]) || $artwork[zpms] == 'false'){echo '';}else{echo "<div class='artwork_list_title_left'>艺术品描述</div><div class='artwork_infos'>".$artwork[zpms]."</div>";}}-->

  </div>
  <div class='bottom-bar'>

      <!--{if $artwork[chushou]=='是'}-->
    <div id="bargain_price" class='artwork_price' style=" display:none;">
      特价 <!--{eval echo $artwork[bargain_price];}--> RMB
    </div>
    <div id="original_price" class='artwork_price_original' style=" display:none; font-size:13px; color:gray; padding: 22px 0 0 0;">
      原价 <!--{eval echo $artwork[price];}--> RMB
    </div>    
    <div id="price" class='artwork_price'>
      售价 <!--{eval echo $artwork[price];}--> RMB
    </div>
      <!--{if $artwork[is_print]=='是'}-->
      <a href='/wap_choose_print.php?art_id=<!--{eval echo $artwork[id];}-->' class='buy_now'>立即购买</a>
      <!--{else}-->
      <a href='/wap_login.php?art_id=<!--{eval echo $artwork[id];}-->' class='buy_now'>立即购买</a>
      <!--{/if}-->

      <!--{elseif $artwork[chushou]=='否'}-->
      <div href="tel:4008-566-108" class='artwork_price'><!--{eval echo '展示';}--></div>
      <a class='connect_service'>联系客服</a>
      <!--{else}-->
      <div class='artwork_price'><!--{eval echo $artwork[chushou];}--></div>
      <a href="tel:4008-566-108" class='connect_service'>联系客服</a>
      <!--{/if}-->
  </div>
  <div class="artwork_block">
    <div class='artwork_info_four counts' style='display:none;font-size:15px; text-align:center'><i class='icon-eye-open'></i> <span class='pvCount'><!--{eval echo $pvCount;}--></span>次浏览 | <i class='icon-thumbs-up'></i> <span class='follownum'><!--{eval echo $artwork[attention];}--></span>个赞</div>
    <a href='javascript:void(0);' class='artwork_zan <!--{if $canFollow}-->followit<!--{else}-->followed<!--{/if}-->'><!--{if $canFollow}--><i class='icon-thumbs-up'></i>赞<!--{else}--><i class='icon-thumbs-up'></i>已赞<!--{/if}--></a>
    <input type="hidden" class="follow_artid" value="<!--{eval echo $artwork[id];}-->">
    <div class='view_user_list' style='display:none;'></div>
    <div class='artwork_info_four' style='font-size:15px; text-align:center'><i class='icon-comment'></i> 和艺术家聊一聊</div>
    <div class='artwork_info_four'>
      <input class='comment' placeholder='说说你对艺术品的感受' id='contents'/>
    
      
    <span class='comment_user1' <!--{if !$username}-->style='display:none;'<!--{/if}-->>
      <input type='button' class='submit' value='发送' id='submit'/>
      <input type="hidden" id="name" value="<!--{eval echo $username;}-->">
    </span>
    <span class='comment_user2' <!--{if $username}-->style='display:none;'<!--{/if}-->>
      <a href='http://m.artgogo.com/newwap/usercenter/user_login.php' class='login_first'>请先登录</a>
      <input type="hidden" id="name" value="<!--{eval echo '匿名';}-->">
    </span>
    </div>
    <script type='text/javascript'>
        $(function(){
            $('.followit').live('click',function(){
                var art_id=$('.follow_artid').val();
                var art_type=1;
                var type=1;
                $.ajax({
                    url:'http://m.artgogo.com/artwork.php?act=2',
                    dataType:'json',
                    type:'get',
                    data:{
                        art_id:art_id,
                        art_type:art_type,
                        type:type,
                        ajax:true
                    },
                    success:function(rs){
                        if( rs['suc'] ){
                            $('.followit').addClass('followed');
                            $('.followit').html('已赞');
                            $('.followed').removeClass('followit');
                            if( rs['num'] ){
                                $('.follownum').html(rs['num']);
                            }
                        }
                    }
                });
            });
            
            // 倒计时变量
            <!--{eval if(!empty($artwork[bargain_start_time]) && !empty($artwork[bargain_duration]) && !empty($artwork[bargain_price]) && $artwork[bargain_price]!=0){echo 'var is_bargain=true;';}else{echo 'var is_bargain=false;';}}-->
            var before_bargain=false;
            var in_bargain=false;
            var bargain_date;
            var bargain_start_milliseconds;
            var bargain_end_milliseconds;
            var now_milliseconds=new Date().getTime();
            var bargain_start_time;
            if(is_bargain){
                bargain_start_time='<!--{eval echo $artwork[bargain_start_time];}-->';
                // 调整日期中的-为/，以提高对于浏览器的兼容,bargain_duration单位为小时
                bargain_start_time=bargain_start_time.replace(/-/g, "/");
                var bargain_begin_date=new Date(bargain_start_time);
                var bargain_date=new Date(bargain_start_time);
                var bargain_start_milliseconds=bargain_date.getTime();
                var bargain_end_milliseconds=bargain_date.getTime()+ <!--{eval echo $artwork[bargain_duration];}-->*60*60*1000;
                bargain_date.setTime(bargain_end_milliseconds);
                if(now_milliseconds>bargain_start_milliseconds && now_milliseconds<bargain_end_milliseconds)in_bargain=true;
                else if(now_milliseconds<bargain_start_milliseconds)before_bargain=true;
                else in_bargain=false;
            }
            
            if(in_bargain){
                $("#original_price").show();
                $("#bargain_price").show();
                $("#price").hide();
                $(".countdown").show();
                $('.countdown').downCount({
                    date: bargain_date,
                    offset: +8
                }, function () {
                    $("#original_price").hide();
                    $("#bargain_price").hide();
                    $("#price").show();
                    $(".countdown").hide();
                });
            } else if(before_bargain){
                $("#countdownTitle").text("距离开始还有：");
                $(".countdown").show();
                $('.countdown').downCount({
                    date: bargain_begin_date,
                    offset: +8
                }, function () {
                    document.location.reload();
                });
            }
        });
    </script>
  </div>
  <div class="artwork_block">
    <!--{if !empty($relations)}-->
    <div class='artwork_list_title'><!--{eval echo $artist[Title];}--> 更多作品</div>
    <div class='artist_artworks_list'>
      <!--{eval foreach($relations as $relation){}-->
      <li class='print_artwork'>
        <a href="http://m.artgogo.com/artwork.php?id=<!--{eval echo $relation[id];}-->">
          <img src="<!--{eval echo str_replace('/artwork/', '/yishupin/', $relation[cover])}-->" />
          <span class='artwork_title'><!--{eval echo $relation[Title];}--></span>
          <span class='view_artwork'>查看详情</span>
          <span class='artwork_list_price'>
            <!--{if $relation[chushou]=='是'}-->RMB <!--{eval echo $relation[price];}--> 元
            <!--{elseif $relation[chushou]=='否'}--><!--{eval echo '展示';}-->
            <!--{else}--><!--{eval echo $relation[chushou];}-->
            <!--{/if}-->
          </span>
        </a>
        <div class='clear'></div>
      </li>
      <!--{eval }}-->
    </div>
    <!--{/if}-->
  </div>
</article>

<div class='clear'></div>
<script src="/js/wap.js" type="text/javascript"></script>
<script type="text/javascript">
    $(window).load(function() {
        //记录访客
        $.ajax({
            type:'get',
            url:'http://m.artgogo.com/artwork.php?act=1',
            dataType:'json',
            data:{
                id:itemid
            },
            success:function(rs){}
        });
        
        //点赞判断、登录再判断
        $.ajax({
            type:'get',
            url:'http://m.artgogo.com/artwork.php?act=4',
            dataType:'json',
            data:{
                id:itemid
            },
            success:function(rs){
                if( rs['data']['canFollow'] ){
                    $('.artwork_zan').removeClass('followed');
                    $('.artwork_zan').addClass('followit');
                    $('.artwork_zan').html('赞');
                }
                if( rs['data']['username'] ){
          checkload=true;
                    /*var contents="<input type='button' class='submit' value='发送' id='submit'/>"+
                        "<input type='hidden' id='name' value='"+rs['data']['username']+"'>";*/
                    //$('.comment_user').html(contents);
          $('#name').val(rs['data']['username']);
          $('.comment_user2').remove();
          $('.comment_user1').show();
                }
            }
        });
        
        //浏览次数、点赞次数
        $.ajax({
            type:'get',
            url:'http://m.artgogo.com/artwork.php?act=3',
            dataType:'json',
            data:{
                id:itemid
            },
            success:function(rs){
                var pvCount=0;
                if( rs['data']['pvCount'] )
                    pvCount=rs['data']['pvCount'];
                $('.pvCount').html(pvCount);
                $('.counts').show();

                if( rs['data']['visitors'] ){
                    var Obj=new wapjs();
                    var contents=Obj.artwork.visitors(rs['data']['visitors']);
                    $('.view_user_list').html(contents);
                    $('.view_user_list').show(); 
                }
            }
        });
    });
</script>
<script>
var _hmt = _hmt || [];
(function() {
  var hm = document.createElement("script");
  hm.src = "//hm.baidu.com/hm.js?5a39743a86de50a2475155ba514968f4";
  var s = document.getElementsByTagName("script")[0]; 
  s.parentNode.insertBefore(hm, s);
})();
</script>

</body>
